package by.gusto.afisha.logic;

import android.content.Context;
import by.gusto.afisha.R;

public enum MenuItemType {

	SEARCH(R.string.menu_item_search), MAP(R.string.menu_item_map), SETTINGS(R.string.menu_item_settings);

	public static final int ARRAY_ID = R.array.menu_items;
	private int typeValue;
	
	private MenuItemType(int value) {
		typeValue = value;
	}
	
	public static MenuItemType getType(Context context, String value){
		for(MenuItemType type : MenuItemType.values()){
			if(context.getString(type.typeValue).equals(value))
				return type;
		}
		throw new IllegalArgumentException("type for value " + value + " not found");
	}
}
